package Java学习.面向对象.内部类.局部内部类;

public class Outer {
    int b=20;
    public void show(){
        int a=10;
        //局部内部类
        class Inter{
            String name;
            int age;
            public void method1(){
                System.out.println(a);
                System.out.println(b);
                System.out.println("局部内类method1");
            }
            public static void method2(){
                System.out.println("局部内类method2中的静态方法");
            }
        }
        //创建局部内部类的对象
        Inter i=new Inter();
        System.out.println(i.age);
        i.method1();

    }

}
class Text{
    public static void main(String[] args) {
        Outer o =new Outer();
        o.show();
    }
}
